window.bridge = {
    show: function() {
        channel.show();
    },
    choosePicture: function() {
        return new Promise((resolve) => {
            channel.choosePicture(function (data) {
                resolve(data);
            });
        });
    },
    choosePictures: function() {
        return new Promise((resolve) => {
            channel.choosePictures(function (data) {
                resolve(data);
            });
        });
    },
    chooseFilePath: function(t='[("所有文件", "*.*")]') {
        return new Promise((resolve) => {
            channel.chooseFile(t, function (data) {
                resolve(data);
            });
        });
    },
    chooseFilesPath: function(t='[("所有文件", "*.*")]') {
        return new Promise((resolve) => {
            channel.chooseFiles(t, function (data) {
                resolve(data);
            });
        });
    },
    chooseDirPath: function() {
        return new Promise((resolve) => {
            channel.chooseDir(function (data) {
                resolve(data);
            });
        });
    },
    reloadPage: function() {
        window.location.href = window.location.href = window.location.href.toString()
    },
    maxWindow: function() {
        channel.maxWindow();
    },
    normalWindow: function() {
        channel.normalWindow();
    },
    hideWindow: function() {
        channel.hideWindow();
    },
    closeWindow: function() {
        channel.closeWindow();
    },
    exitApp: function() {
        channel.exitApp();
    },
};
